001 /** 002 * Created by IntelliJ IDEA. 003 * User: Wei Wang 004 * Date: Feb 24, 2003 005 * Time: 4:18:16 PM 006 */ 007 008 package EVolve.util.painters; 009 010 import EVolve.visualization.*; 011 012 public class EventPredictionPainter extends PredictionPainter{ 013 private int lineWidth; 014 015 public void paint(AutoImage image, long x, long y, long z) { 016 int X = (int)(x%lineWidth), Y= (int)(x/lineWidth); 017 predictor[(int)y].newTarget(z); 018 019 if (validateTarget(y,z)) { 020 if (predictor[(int)y].isCorrect()) { 021 if (image.getColor(X, Y) == null) { 022 image.setColor(X, Y, colorBlue); 023 } 024 } else { 025 image.setColor(X, Y, colorRed); 026 miss[(int)y]++; 027 } 028 } else { 029 if (image.getColor(X, Y) == null) { 030 image.setColor(X, Y, colorBlue); 031 } 032 } 033 } 034 035 public void setParameters(Predictor[] predictor, int targetType, int lineWidth) { 036 setPredictor(predictor,targetType); 037 this.lineWidth = lineWidth; 038 } 039 040 }